/*
 * (c) 2020 <tanghaifeng-gz@loongson.cn> <pengren.mcu@qq.com>
 *
 * SPDX-License-Identifier:	GPL-2.0+
 *
 */

#ifndef __LS2K_ZX5108_CONFIG_H
#define __LS2K_ZX5108_CONFIG_H

#define CONFIG_RECOVER

#include "ls2k_zx_come.h"
#include "loongson_bootmenu.h"

/* Loongson bootelf bootparam smbios */
#define CONFIG_LOONGSON_BOARD_NAME "LS2K1000-ZX5108"

/* Framebuffer and LCD */
#if defined(CONFIG_VIDEO_LS1X)
#define LS1X_DC0
//#define LS1X_DC0_USE_DEMODE
#define LS1X_DC1
//#define LS1X_DC1_USE_DEMODE
#define LS1X_DC_MAX 2
#endif

#undef RECOVER_DEFAULT_ENV
#define RECOVER_DEFAULT_ENV setenv bootargs console=ttyS0,115200 rd_start=${rd_start} rd_size=${rd_size} \
mtdparts=${mtdparts} \
root=/dev/ram rw rootfstype=ext2 console=tty2 loglevel=0 \
video=${video};\
bootm ${loadaddr}

#undef BOOT_SATA_DEFAULT
#define BOOT_SATA_DEFAULT "setenv bootargs quiet \
rootfstype=ext4 rw rootwait console=tty2 loglevel=0; \
setenv bootcmd ' setenv bootargs ${bootargs} root=/dev/${root_dev}${syspart} mtdparts=${mtdparts} video=${video}; \
scsi scan;ext4load scsi 0:${syspart} ${loadaddr} /boot/uImage;bootm ';\
saveenv;\
boot"

#undef BOOT_NAND_DEFAULT
#define BOOT_NAND_DEFAULT "setenv bootargs console=ttyS0,115200 \
root=ubi0:rootfs ubi.mtd=root,2048 noinitrd init=/sbin/init rootfstype=ubifs rw; \
setenv bootcmd ' setenv bootargs ${bootargs} mtdparts=${mtdparts} video=${video}; \
sf probe;sf read ${fdt_addr} dtb;nboot kernel;bootm ';\
saveenv;\
boot"

#define	CONFIG_EXTRA_ENV_SETTINGS					\
	CONSOLE_STDOUT_SETTINGS \
	LOONGSON_BOOTMENU \
	"loadaddr=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
	"fdt_addr=" __stringify(FDT_LOAD_ADDR) "\0" \
	"rd_start=" __stringify(RAMDISK_START) "\0" \
	"rd_size=" __stringify(RAMDISK_SIZE) "\0" \
	"mtdids=" CONFIG_MTDIDS_DEFAULT "\0"					\
	"mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0"				\
	"splashpos=m,m\0" \
	"video=" "VGA-1:480x480-16@60 video=VGA-2:480x480-16@60" "\0" \
	"panel0=" "lcms034va07" "\0" \
	"panel1=" "lcms034va07" "\0" \
	"rotation=3\0" \
	"root_dev=sda\0" \
	"syspart=1\0" \
	"update=1\0" \

#define CONFIG_LS2K_USED_LINUX3_10

#endif	/* __LS2K_ZX5108_CONFIG_H */
